Skip to content

pm-stack: enforce the argument contract in eleven more operator scripts - #10907

Merged
dezren39 merged 1 commit into
mainfrom
claude/operator-arg-contract-3
Nov 17, 2026
Merged

dezren39 merged 1 commit into
mainfrom
claude/operator-arg-contract-3

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Before: eleven more pm-stack operator scripts silently ignored arguments they don't take. deploy.sh deploy extra (Kaneo, Grist, Pad) went ahead and redeployed, seed.sh --dry-run seeded for real, the drills and push-fleet-feed.sh ran on any argv, and kaneo-sync-guard.py and opencode-claimant/poll.py ignored theirs. Separately, pm-stack/tests/test_kaneo_sync_guard.py errored in 4 of its 5 cases on main.

After: each script checks its whole command line first and refuses anything unaccounted for with a usage line naming it and exit 2, before any work:

  • deploy.sh, grist/deploy.sh, pad/deploy.sh: at most one of deploy (default), render, restart. An explicit empty argument is refused too.
  • grist/seed.sh, pad/seed.sh, projector/scripts/setup-deps.sh, aggregator/scripts/push-fleet-feed.sh, kill-collector-drill.sh, age-feed-drill.sh: no arguments (the drills' knobs stay PM_DRILL_* environment variables).
  • kaneo-sync-guard.py, opencode-claimant/poll.py: no arguments. The check sits in the __main__ block, so tests that call main() directly are unaffected.

The Kaneo guard tests pass again (5/5).

How: a guard right after set -euo pipefail in each shell script, per the operator script argument contract (#3352). The test fix teaches the fake psql the #10140 compaction rewrite and makes it list configs in Kaneo's compact JSON form, which a conforming row has. ruff format was applied to the two Python scripts and the test (kaneo-sync-guard.py had a little pre-existing format drift, now gone).

Testing: bash -n and py_compile on all files; every script rejects a stray argument with exit 2; scripts/seed-smoke.test.sh, scripts/tailnet-bindings.test.sh, scripts/deploy-install-smoke.test.sh, push-fleet-feed.guard.sh, the two drill test files (18 pass), tests/test_kaneo_sync_guard.py (5 pass) and opencode-claimant/test_poll.py (92 pass).

Fixes #10472
Fixes #10442
Fixes #10440
Fixes #10428
Fixes #10484
Fixes #10485
Fixes #10474
Fixes #10475
Fixes #10441
Fixes #10473
Fixes #10434


Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The Kaneo, Grist and Pad deploy.sh scripts now accept at most one of
deploy, render or restart; the Grist and Pad seed.sh scripts, the
projector setup-deps.sh, the aggregator push-fleet-feed and both drills,
kaneo-sync-guard.py and opencode-claimant/poll.py take no arguments.
Each refuses anything else with a usage error and exit 2 before any
work (#3352).

Also repairs tests/test_kaneo_sync_guard.py, which errored 4 of 5 cases
on main: its fake psql predated the #10140 compaction rewrite and listed
configs in spaced JSON, which the guard now treats as drift.

Fixes #10472
Fixes #10442
Fixes #10440
Fixes #10428
Fixes #10484
Fixes #10485
Fixes #10474
Fixes #10475
Fixes #10441
Fixes #10473
Fixes #10434

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 marked this pull request as ready for review November 17, 2026 02:18
@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 02:18
@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T02:18:23.510305Z
We couldn’t complete this review. Comment @codex review to try again.
aac680c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit ba7edb1 into main Nov 17, 2026
@dezren39
dezren39 deleted the claude/operator-arg-contract-3 branch November 17, 2026 02:18
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment